SDK Introduction

更新时间:
2024-07-05
下载文档

SDK Introduction

EdgerOS Web-SDK is a front-end development kit that provides various interactive interfaces for the front end of EdgerOS App, and the front end of EdgerOS App correctly uses Web-SDK.

EdgerOS Web-SDK supports both JavaScript and TypeScript development.

npm install

You can use command npm i @edgeros/web-sdk to install EdgerOS Web-SDK.

  • TypeScript
import '@edgeros/web-sdk'
  • JavaScript

You can click sdk.min.jsopen in new window to view and download sdk.min.js.

<script src="\\PATH/sdk.min.js"></script>

Test

After the @edgeros/web-sdk module is correctly import, the browser window object will contain the edger member:

console.log(window.edger); // Web-SDK object show

Style

Most Web-SDK functions return Promise objects, for example, the following function obtains the Web-SDK version:

edger.version().then(data => {
  console.log('Version:', data.version);
}).catch(error => {
  console.error(error);
});

Web-SDK functions

Security

App front-end and back-end secure communication specifications. See details: Security.

Account

Web-SDK provides information about users who are currently accessing EdgerOS device. See details: Account.

Lifecycle

Apps call this interface to manage its life cycle. See details: Lifecycle.

Permission

App front end can obtain and check related permissions by using these functions. See details: Permission.

PermissionTexts

Apps call these interfaces to manage the permission texts for dialogs and drawers. See details: PermissionTexts.

State & gestures

Front-end state and gestures. See details: State.

SafeArea

EdgerOS App can get current safeArea information. See details: SafeArea.

Theme

Get the current display theme of EdgerOS, the App can dynamically select its own display style according to the theme information. See details: Theme.

Notify

Apps call this interface to pop up system notify information. See details: Notify.

Share

Apps can share messages with each other by using these functions. See details: Share.

Network

These functions provide current EdgerOS device network working information. See details: Network.

AcoPay

EdgerOS online payment system 翼辉支付. This payment system uses WeChat Pay or Alipay payment channels. App can use this payment system to complete on-site payments. See details: AcoPay.

Mobile

Operate current mobile functions, such as camera, etc. See details: Mobile.

Orientation

Obtain and control the current display orientation of EdgerOS. See details: Orientation.

Language

Apps can get EdgerOS current language information. See details: Language.

Download

EdgerOS provides download function. See details: Download.

Filesystem

EdgerOS provides filesystem function. See details: Filesystem.

Album

Apps call these interfaces to access system album. See details: Album.

Device

Apps call these interfaces to obtain information about smart devices that have been scanned and found to have access to EdgerOS. See details: Device.

Audio

Apps call these interfaces to access the audio player. See details: Audio.

Caster

Apps call these interfaces to implement screen casting functions. See details: Caster.

Dialog

Apps call these interfaces to access dialog. See details: Dialog.

FilePreview

Apps call these interfaces to preview files. See details: FilePreview.

Float

The float module provides some interfaces to manage float. See details: Float.

Geolocation

Apps call these interfaces to access geographic locations. See details: Geolocation.

Job

Apps call these interfaces to manage background job. See details: Job.

Loading

Apps call this interface to creat a loading instance. See details: Loading.

Media

Apps call this interface to creat a media player instance. See details: Media.

MultiplePanel

The multiplePanel module provides a capability which can help you share images or files with others. See details: MultiplePanel.

Service

Apps call these interfaces to automatically manage jobs. See details: Service.

SystemShare

This share module provides many interfaces for sharing files such as pictures, audio, videos, and documents through native apps. See details: SystemShare.

Toast

Apps call this interface to access toast. See details: Toast.

FileConvert

Apps call these interfaces to convert file formats. See details: FileConvert.

Font

Apps call this interface to obtain font scaling ratio. See details: Font.

文档内容是否对您有所帮助?
有帮助
没帮助